
@include('public.page_styles')
<link rel="stylesheet" href="{{ asset("/AdminLTE/bower_components/bootstrap-daterangepicker/daterangepicker.css") }}">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
@include('public.top')
  <!-- Left side column. contains the logo and sidebar -->
@include('public.sidebar')
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        {{ trans('message.stateConfig') }}
        <small>{{ trans('message.add') }}</small>
      </h1>
      <ol class="breadcrumb">
        <li><a ><i class="fa fa-dashboard"></i> {{ trans('message.home') }}</a></li>
        <li><a href="{{ url('stateConfig/list') }}"> {{ trans('message.stateConfig') }} {{ trans('message.list') }}</a></li>
        <li class="active">{{ trans('message.stateConfig') }}{{ trans('message.add') }}</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-md-12">
          <!-- Horizontal Form -->
          <div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title"> {{ trans('message.add') }}</h3>
              <div class="box-tools">
                <div class="btn-group pull-right" style="margin-right: 10px">
                  <a href="{{ url('stateConfig/list') }}" class="btn btn-sm btn-default"><i class="fa fa-list"></i>&nbsp; {{ trans('message.list') }}</a>
                </div>
                <div class="btn-group pull-right" style="margin-right: 10px">
                  <a class="btn btn-sm btn-default form-history-back" onclick="goBack()" ><i class="fa fa-arrow-left"></i>&nbsp;{{ trans('message.history-back') }}</a>
                </div>
              </div>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form name="createForm" action="{{url('stateConfig/')}}" method="post"  class="form-horizontal" >
              <input type="hidden" name="_token" value="{{ csrf_token() }}">
              <div class="box-body">

              <div class="form-group {!! !$errors->has('keywords') ?: 'has-error' !!}">
                  <label for="keywords" class="col-sm-2 control-label">关键字</label>
                  <div class="col-sm-8">
                      <span class="form-control-require">*</span>
                      <input type="text" class="form-control" id="keywords" name="keywords" placeholder="关键字" value="{{ old('keywords') }}" onkeyup= "if(! /^[a-zA-Z0-9_\s]*$/.test(this.value)){alert('只能输入字母');this.value='';}"  required autofocus>
                      @if($errors->has('keywords'))
                          @foreach($errors->get('keywords') as $message)
                              <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i>{{$message}}</label></br>
                          @endforeach
                      @endif
                  </div>
              </div>

              <div class="form-group {!! !$errors->has('state') ?: 'has-error' !!}">
                  <label for="state" class="col-sm-2 control-label">状态值</label>
                  <div class="col-sm-8">
                      <span class="form-control-require">*</span>
                      <input type="text" class="form-control" id="state" name="state" placeholder="状态值" value="{{ old('state') }}" onkeyup= "if(! /^[0-9]{1,2}$/.test(this.value)){alert('只能输入数字');this.value='';}" required >
                      @if($errors->has('state'))
                          @foreach($errors->get('state') as $message)
                              <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i>{{$message}}</label></br>
                          @endforeach
                      @endif
                  </div>
              </div>


            <div class="form-group {!! !$errors->has('stateName') ?: 'has-error' !!}">
              <label for="stateName" class="col-sm-2 control-label">状态名称</label>
              <div class="col-sm-8">
                  <span class="form-control-require">*</span>
                <input type="text" class="form-control" id="stateName" name="stateName" placeholder="状态名称" value="{{ old('stateName') }}"  onkeyup= "if(! /[a-z\u554A-\u9C52]+$/.test(this.value)){alert('只能输入汉字');this.value='';}" required>
                  @if($errors->has('stateName'))
                      @foreach($errors->get('stateName') as $message)
                          <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i>{{$message}}</label></br>
                      @endforeach
                  @endif
              </div>
            </div>

              <div class="form-group">
                  <label for="remark" class="col-sm-2 control-label">备注</label>
                  <div class="col-sm-8">
                      <input type="text" class="form-control" id="remark" name="remark" placeholder="" value="{{ old('remark') }}"  >
                  </div>
              </div>

              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                <div class="col-sm-2">
                </div>
                <div class="col-sm-8">
                  <div class="btn-group pull-right">
                    <button type="button" class="btn btn-info pull-right btn-js-form-submit" >提交</button>
                  </div>
                  <div class="btn-group pull-left">
                    <button type="reset" class="btn btn-warning">撤销</button>
                  </div>
                </div>
              </div>
              <!-- /.box-footer -->
            </form>
          </div>
          <!-- /.box -->
        </div>
        <!--/.col (right) -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
@include('public.bottom')

  <!-- Control Sidebar -->
{{--@include('public.aside')--}}
  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

@include('public.javascript')
<script src="{{ asset ("/AdminLTE/bower_components/fastclick/lib/fastclick.js") }}" type="text/javascript"></script>
<script src="{{ asset ("/AdminLTE/dist/js/demo.js") }}" type="text/javascript"></script>
<script src="{{ asset ("/AdminLTE/bower_components/moment/min/moment.min.js") }}" type="text/javascript"></script>
<script src="{{ asset ("/AdminLTE/bower_components/bootstrap-daterangepicker/daterangepicker.js") }}" type="text/javascript"></script>

<script type="text/javascript">

jQuery(function ($) {
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': '{{ csrf_token() }}'
        }
    });


    @if(session()->has('fail'))
      alertMess("{{session()->get('fail')}}");
    @endif



});




var _ajaxSubmitSending = false;
$(".btn-js-form-submit").click(function (e) {
    if (_ajaxSubmitSending) {
        return;
    } else {
        _ajaxSubmitSending = true;
        _loadingFuc();
    }
    $('form[name="createForm"]').submit();
    _ajaxSubmitSending = false;
    setTimeout(function(){
        $.unblockUI();
    }, 1500);
});

</script>

</body>
</html>
